#ifndef __LEOS_DEF_H__
#define __LEOS_DEF_H__

typedef signed long long                le_int64_t;
typedef unsigned long                   le_uint32_t;
typedef signed long                     le_int32_t;
typedef unsigned char                   le_uint8_t;
typedef signed char                     le_int8_t;

#define LE_THREAD_STATE_INIT            0x00
#define LE_THERAD_STATE_READY           0x01
#define LE_THREAD_STATE_SUSPEND         0x02
#define LE_THREAD_STATE_RUNNING         0x03
#define LE_THREAD_STATE_BLOCK           LE_THREAD_STATE_SUSPEND
#define LE_THREAD_STATE_CLOSE           0x04

#define LE_NULL                         (0)

#define LE_TRUE                         1
#define LE_FALSE                        0

#define LE_ALIGN(size, align)           ((size) + (align) - 1 & ~((align) - 1))
#define LE_ALIGN_DOWN(size, align)      ((size) & ~((align) - 1))

#define LE_ARRAY_SIZE(array)            (sizeof(array) / sizeof((array)[0]))

#define le_offset_of(type, member)      ((unsigned long)(&(((type *)0)->member)))
#define le_container_of(ptr, type, member) \
            ((type *)((char *)(ptr) - le_offset_of(type, member)))

#define le_inline                       static __inline

#endif
